package com.kiln.juxingqs.api

import client.global.commlib.comm_ui.bean.CommImg
import client.global.commlib.network.data.JsonResult
import client.global.commlib.network.data.Ret
import client.global.commlib.network.data.WlDetail
import com.kiln.juxingqs.api.bean.*
import okhttp3.MultipartBody
import okhttp3.RequestBody
import retrofit2.Response
import retrofit2.http.*

interface Oserve {
    /**
     * 登录
     */
    @FormUrlEncoded
    @POST("/users/login/")
    suspend fun login(
        @Field("username") phone: String,
        @Field("password") password: String,
        @Field("device") device: String,
        @Field("device_id") device_id: String,
        @Field("device_name") device_name: String
    ): Response<JsonResult<Auth>>

    /**
     * 注册
     */
    @FormUrlEncoded
    @POST("/users/signup/")
    suspend fun register(
        @Field("username") username: String,
        @Field("phone") phone: String,
        @Field("password") password: String,
        @Field("password2") password2: String,
        @Field("captcha") captcha: String,
        @Field("invite") invite: String,
//        @Field("real_name") real_name: String,
//        @Field("id_card") id_card: String,
//        @Field("id_img") id_img: String,
        @Field("sex") sex: String,
    ): Response<JsonResult<Ret>>

    /**
     * 实名认证
     */
    @FormUrlEncoded
    @POST("/users/user_real_name/")
    suspend fun user_real_name(
        @Field("real_name") real_name: String,
        @Field("id_card") id_card: String,
        @Field("id_img") id_img: String,
        @Field("c_type") c_type: String,
        @Field("cert_begin_date") cert_begin_date: String?,
        @Field("cert_end_date") cert_end_date: String?,
    ): Response<JsonResult<Ret>>

    /**
     * 获取验证码
     */
    @FormUrlEncoded
    @POST("/common/captcha/")
    suspend fun getcode(
        @Field("phone") phone: String,
        @Field("ts") ts: String,
        @Field("sign") sign: String
    ): Response<JsonResult<Ret>>

    /**
     * 忘记密码
     */
    @FormUrlEncoded
    @POST("/users/forget_pwd/")
    suspend fun forget_pwd(
        @Field("username") username: String,
        @Field("phone") phone: String,
        @Field("captcha") captcha: String,
        @Field("new_pwd") new_pwd: String,
        @Field("new_pwd2") new_pwd2: String
    ): Response<JsonResult<Ret>>

    /**
     * 修改手机号
     */
    @FormUrlEncoded
    @POST("/users/update_phone/")
    suspend fun update_phone(
        @Field("phone") phone: String,
        @Field("captcha") captcha: String,
        @Field("new_phone") new_pwd: String,
    ): Response<JsonResult<Ret>>

    /**
     * 重置实名
     */
    @FormUrlEncoded
    @POST("/users/update_real/")
    suspend fun update_real(
        @Field("phone") phone: String,
        @Field("captcha") captcha: String,
    ): Response<JsonResult<Ret>>

    /**
     * 注销账号
     */
    @FormUrlEncoded
    @POST("/users/update_logout/")
    suspend fun update_logout(
        @Field("phone") phone: String,
        @Field("captcha") captcha: String,
    ): Response<JsonResult<Ret>>


    /**
     * 修改密码
     */
    @FormUrlEncoded
    @POST("/users/reset_pwd/")
    suspend fun set_pwd(
        @Field("old_pwd") old_pwd: String,
        @Field("new_pwd") new_pwd: String,
        @Field("new_pwd2") new_pwd2: String
    ): Response<JsonResult<Ret>>

    /**
     * 修改支付密码
     */
    @FormUrlEncoded
    @POST("/users/forget_pay/")
    suspend fun forget_pay(
        @Field("username") username: String,
        @Field("phone") phone: String,
        @Field("captcha") captcha: String,
        @Field("new_pwd") new_pwd: String,
        @Field("new_pwd2") new_pwd2: String
    ): Response<JsonResult<Ret>>

    /**版本控制
     *
     */
    @FormUrlEncoded
    @POST("/index/get_update/")
    suspend fun get_update(
        @Field("device") device: String,
        @Field("version") version: String
    ): Response<JsonResult<VersionRet>>

    //todo

    /**
     * 绑卡信息列表
     */
    @GET("/users/user_card_list/")
    suspend fun user_card_list(): Response<JsonResult<UserCards>>

    //银行绑卡
    @POST("/users/bind_card/")
    @FormUrlEncoded
    suspend fun bind_card(
        @Field("tel_no") tel_no: String,
        @Field("card_id") card_id: String,
//        @Field("bank_name") bank_name: String,
//        @Field("c_type") c_type: String,
//        @Field("vip_code") vip_code: String,
//        @Field("expiration") expiration: String,
    ): Response<JsonResult<BankBind>>

    //银行绑卡验证
    @POST("/users/check_bind_card/")
    @FormUrlEncoded
    suspend fun check_bind_card(
        @Field("sms_code") sms_code: String,
        @Field("apply_id") apply_id: String,
    ): Response<JsonResult<Ret>>

    //确认充值接口
    @POST("/users/confirm_pay/")
    @FormUrlEncoded
    suspend fun confirm_pay(
        @Field("sms_code") sms_code: String,
        @Field("payment_id") payment_id: String,
    ): Response<JsonResult<Ret>>

    //选择卡支付
    @POST("/users/save_card/")
    @FormUrlEncoded
    suspend fun save_card(
        @Field("id") id: String,
        @Field("card_id") card_id: String,
    ): Response<JsonResult<Ret>>

    /**
     * 通知
     */
    @GET("/index/common_img/")
    suspend fun common_img(): Response<JsonResult<CommImg>>

    /**
     * 通知
     */
    @GET("/index/notice/")
    suspend fun get_notification(): Response<JsonResult<Norification>>

    @Multipart
    @POST("/common/upload/")
    suspend fun upload(
        @Part("description") requestBody: RequestBody,
        @Part file: MultipartBody.Part?
    ): Response<JsonResult<UploadRet>>

    @Multipart
    @POST("/users/hfb_upload_img/")
    suspend fun hfb_upload_img(
        @Part("img_type") img_type: RequestBody,
        @Part file: MultipartBody.Part?
    ): Response<JsonResult<UploadRet>>

    /**
     * 设置头像
     */
    @FormUrlEncoded
    @POST("/users/user_avatar/")
    suspend fun user_avatar(
        @Field("avatar") avatar: String
    ): Response<JsonResult<Ret>>

    /**
     * 商品首页
     */
    @GET("/mall/goods_index/")
    suspend fun goods_index(@Query("name") name: String = ""): Response<JsonResult<GoodsIndex>>

    /**
     * 转让首页
     */
    @GET("/mall/goods_trade/")
    suspend fun trade_index(
        @Query("name") name: String = "",
        @Query("deal_status") deal_status: String = ""
    ): Response<JsonResult<GoodsIndex>>

    /**
     * 资讯详情
     */
    @GET("/index/article_info/")
    suspend fun article_info(): Response<JsonResult<ArticleInfo>>

    /**
     * 用户信息
     */
    @GET("/users/user_info/")
    suspend fun userinfo(): Response<JsonResult<UserInfo>>

    /**
     * 会员中心
     */
    @GET("/users/my_member/")
    suspend fun my_member(): Response<JsonResult<MyMember>>

    /**
     * 搜索
     */
    @FormUrlEncoded
    @POST("/mall/goods_search/")
    suspend fun searchRet(
        @Field("page") page: Int,
        @Field("goods_name") goods_name: String,
        @Field("price_status") price_status: String,
        @Field("sales_status") sales_status: String
    ): Response<JsonResult<SeartchRet>>

    //商品购买
    @Headers("Content-Type: application/json;charset=UTF-8")
    @POST("/mall/buy_goods/")
    suspend fun goods_buy(@Body obj: RequestBody): Response<JsonResult<Ret>>

    @FormUrlEncoded
    @POST("/mall/trade_goods_buy_zj/")
    suspend fun goods_buy_form(
        @Field("goods_id") goods_id: String,
        @Field("num") num: String,
        @Field("goods_price") goods_price: String,
    ): Response<JsonResult<Ret>>

    //获取用户地址
    @GET("/users/user_address/")
    suspend fun getAddress(): Response<JsonResult<UserAddress>>

    /**
     * 取消订单
     */
    @FormUrlEncoded
    @POST("/mall/del_buy_order/")
    suspend fun del_buy_order(
        @Field("order_id") order_id: String
    ): Response<JsonResult<Ret>>

    /**
     * 确认订单
     */
    @FormUrlEncoded
    @POST("/mall/confirm_order/")
    suspend fun confirm_order(
        @Field("order_id") order_id: String
    ): Response<JsonResult<Ret>>

    //商品jil
    @POST("/mall/buy_order_record/")
    @FormUrlEncoded
    suspend fun buy_order_record(
        @Field("page") page: Int,
        @Field("t_type") t_type: Int,
    ): Response<JsonResult<GoodsOrder>>


    //商品jil
    @POST("/mall/buy_order_record/")
    @FormUrlEncoded
    suspend fun buy_order_record_by_id(
        @Field("page") page: Int,
        @Field("t_type") t_type: Int,
        @Field("goods_id") goods_id: String,
    ): Response<JsonResult<GoodsOrder>>

    /**
     *
     */
    @GET("/mall/v2.0/current_order/")
    suspend fun current_order(): Response<JsonResult<CurrOrderRet>>

    //验证支付密码
    @POST("/trading/user_pay_password/")
    @FormUrlEncoded
    suspend fun validatePayPwd(@Field("pay_pwd") pay_pwd: String): Response<JsonResult<Ret>>

    @POST("/trading/upload_img/")
    @FormUrlEncoded
    suspend fun upload_img(
        @Field("order_img") order_img: String,
        @Field("order_id") order_id: String,
        @Field("w_type") w_type: String,
    ): Response<JsonResult<Ret>>

    /**
     * 设置用户收货地址
     */
    @FormUrlEncoded
    @POST("/users/set_user_address/")
    suspend fun set_user_address(
        @Field("address_id") address_id: String,
        @Field("name") name: String,
        @Field("phone") phone: String,
        @Field("province") province: String?,
        @Field("city") city: String?,
        @Field("district") district: String?,
        @Field("place") place: String
    ): Response<JsonResult<Ret>>

    /**
     *
     */
    @FormUrlEncoded
    @POST("/mall/v2.0/seller_confirm/")
    suspend fun seller_confirm(
        @Field("order_id") order_id: String
    ): Response<JsonResult<Ret>>

    @POST("/users/del_address/")
    @FormUrlEncoded
    suspend fun del_address(
        @Field("address_id") address_id: String
    ): Response<JsonResult<Ret>>


    //设置默认收货地址
    @POST("/users/address_default/")
    @FormUrlEncoded
    suspend fun address_default(
        @Field("address_id") address_id: String
    ): Response<JsonResult<Ret>>

    //解绑银行卡
    @POST("/users/un_bind_card/")
    @FormUrlEncoded
    suspend fun un_bind_card(
        @Field("token_no") token_no: String
    ): Response<JsonResult<Ret>>

    //获取购物车
    @POST("/mall/shopping_cart/")
    @FormUrlEncoded
    suspend fun shopping_cart(
        @Field("page") page: String = "1",
    ): Response<JsonResult<BuyCartRet>>

    //删除购物车
    @POST("/mall/del_shopping_cart/")
    @FormUrlEncoded
    suspend fun del_shopping_cart(
        @Field("shopping_id") shopping_id: String,
    ): Response<JsonResult<Ret>>

    /**
     * tx
     */
    @FormUrlEncoded
    @POST("/users/withdraw/")
    suspend fun tx(
        @Field("price") price: String,
        @Field("w_type") w_type: String,
        @Field("pay_type") pay_type: String,
        @Field("captcha") captcha: String,
        @Field("phone") phone: String,
    ): Response<JsonResult<Ret>>

    /**
     *
    提货商品
    按钮：点对点收购  商品买卖 提货
    字段：时间/类型  数量   r_label 20
    资产一
    按钮：预支点对点、提货
    字段：时间/类型  数量   r_label 21
    资产二
    按钮：一键转存 特价购买 提货
    字段：时间/类型  数量    r_label 22
    可交易商品
    按钮：挂单服务中心 挂单供应商 点对点交易 提货
    字段：时间/类型  数量    r_label 23
     */

    /**
     * 资产记录
     * 1 (矿机产出 ) 2 (手续费) 3(矿机奖励) 4(交易) 5(转账)
     * 15.点对点 16.可交易商品-明细-转让详情
     * 商品一:20 商品二:21 特价券:22 可交易商品:23
     * 24.特价 25.优惠
     */
    @FormUrlEncoded
    @POST("/users/income_record/")
    suspend fun jYzcjl(
        @Field("goods_id") goods_id: String,
        @Field("page") page: Int,
        @Field("r_label") r_label: Int,
        @Field("start_time") start_time: String,
        @Field("end_time") end_time: String,
    ): Response<JsonResult<Zcjl>>


    @FormUrlEncoded
    @POST("/users/income_record/")
    suspend fun zcjl(
        @Field("page") page: Int,
        @Field("r_label") r_label: Int,
        @Field("start_time") start_time: String,
        @Field("end_time") end_time: String,
    ): Response<JsonResult<Zcjl>>

    /**
     * 资产记录
     */
    @GET("/mall/buy_deal_today/")
    suspend fun buy_deal_today(
        @Query("page") page: Int,
        @Query("goods_id") goods_id: String,
    ): Response<JsonResult<Jyjl>>

    /**
     * 资产记录
     */
    @FormUrlEncoded
    @POST("/trading/recharge_record/")
    suspend fun recharge_record(
        @Field("page") page: Int,
        @Field("status") status: String
    ): Response<JsonResult<Zcjl>>

    /**
     * 提现记录
     */
    @FormUrlEncoded
    @POST("/users/withdraw_record/")
    suspend fun withdraw_record(
        @Field("page") page: Int,
        @Field("w_type") w_type: Int = 1,
    ): Response<JsonResult<TxJl>>

    //类型详情
    @POST("/mall/goods_type_detail/")
    @FormUrlEncoded
    suspend fun goods_type_detail(
        @Field("page") page: Int,
        @Field("category_id") category_id: String,
    ): Response<JsonResult<CateGoods>>

    //商品详情
    @POST("/mall/goods_detail/")
    @FormUrlEncoded
    suspend fun goods_detail(
        @Field("goods_id") goods_id: String,
        @Field("token") token: String?,
    ): Response<JsonResult<GoodsDetail>>


    //转让详情
    @POST("/mall/trade_detail/")
    @FormUrlEncoded
    suspend fun trade_detail(
        @Field("goods_id") goods_id: String,
        @Field("token") token: String?,
    ): Response<JsonResult<GoodsDetail>>


    //商品买卖详情
    @GET("/mall/trade_goods_detail/")
    suspend fun trade_goods_detail(
        @Query("goods_id") goods_id: String,
    ): Response<JsonResult<TradeGoodsDetail>>

    //批次1
    @GET("/mall/sell_bath/")
    suspend fun sell_bath(
        @Query("page") page: Int
    ): Response<JsonResult<GetBathRet>>

    //转换批次1
    @GET("/mall/freeze_locking_deal/")
    suspend fun freeze_locking_deal(
        @Query("page") page: Int
    ): Response<JsonResult<GetBathRet>>

    //转换提交
    @POST("/mall/freeze_locking_transfer/")
    @FormUrlEncoded
    suspend fun freeze_locking_transfer(
        @Field("bath_id") bath_id: String,
        @Field("num") num: String?,
    ): Response<JsonResult<Ret>>


    //批次1
    @GET("/mall/sell_batch_freeze/")
    suspend fun sell_batch_freeze(
        @Query("page") page: Int
    ): Response<JsonResult<GetBathRet>>

    //点对点交易-批次 点对点可转批次
    @GET("/mall/sell_batch_trade/")
    suspend fun sell_batch_trade(
        @Query("goods_id") goods_id: String,
        @Query("page") page: Int,
    ): Response<JsonResult<GetDddBatchRet>>


    //批次1
    @GET("/mall/buy_deal_record/")
    suspend fun buy_deal_record(@Query("page") page: String): Response<JsonResult<GetPpRet>>

    //关注或取消
    @POST("/mall/collect_goods/")
    @FormUrlEncoded
    suspend fun gz_order(
        @Field("goods_id") goods_id: String,
    ): Response<JsonResult<Ret>>

    //挂买
    @POST("/mall/buyer_order/")
    @FormUrlEncoded
    suspend fun buyer_order(
        @Field("goods_id") goods_id: String,
        @Field("num") num: String,
        @Field("price") price: String,
    ): Response<JsonResult<Ret>>

    //挂卖
    @POST("/mall/seller_order/")
    @FormUrlEncoded
    suspend fun sell_order(
        @Field("bath_id") bath_id: String,
        @Field("num") num: String,
        @Field("price") price: String,
    ): Response<JsonResult<Ret>>

    //挂卖
    @POST("/mall/seller_order/")
    @FormUrlEncoded
    suspend fun sell_order2(
        @Field("goods_id") goods_id: String,
        @Field("num") num: String,
        @Field("price") price: String,
    ): Response<JsonResult<Ret>>

    /**
     * 设置收款信息
     */
    @FormUrlEncoded
    @POST("/users/user_pay_account/")
    suspend fun user_pay_account(
        @Field("pay_type") pay_type: Int
    ): Response<JsonResult<PayAccount>>

    /**
     * 设置收款信息
     */
    @FormUrlEncoded
    @POST("/mall/transfer_take_num/")
    suspend fun transfer_take_num(
        @Field("num") num: String,
        @Field("goods_id") goods_id: String?
    ): Response<JsonResult<Ret>>

    /**
     * 设置收款信息
     */
    @GET("/users/user_pay_account2/")
    suspend fun user_pay_account2(
    ): Response<JsonResult<PayAccount2>>

    //完善资料
    @POST("/users/set_pay_account/")
    @FormUrlEncoded
    suspend fun real_names(
        @Field("real_name") real_name: String,
        @Field("pay_type") pay_type: String,
        @Field("pay_name") pay_name: String,
        @Field("bank_name") bank_name: String,
        @Field("pay_card") pay_card: String,
        @Field("pay_img") pay_img: String,
        @Field("phone") phone: String,
        @Field("captcha") captcha: String,
    ): Response<JsonResult<Ret>>

    //完善资料
    @POST("/users/set_pay_account/")
    @FormUrlEncoded
    suspend fun real_bank(
        @Field("real_name") real_name: String,
        @Field("pay_type") pay_type: String,
        @Field("pay_name") pay_name: String,
        @Field("bank_name") bank_name: String,
        @Field("pay_card") pay_card: String,
        @Field("pay_img") pay_img: String,
        @Field("phone") phone: String,
        @Field("captcha") captcha: String,
        @Field("prov_id") prov_id: String,
        @Field("area_id") area_id: String,
    ): Response<JsonResult<Ret>>


    //完善资料
    @POST("/users/create_pay_user/")
    @FormUrlEncoded
    suspend fun createUser(
        @Field("real_name") real_name: String?,
        @Field("id_card") id_card: String?,
        @Field("id_card_type") id_card_type: String?,
        @Field("begin_date") begin_date: String?,
        @Field("end_date") end_date: String?,
        @Field("phone") phone: String?,
        @Field("manage_region_code") manage_region_code: String?,
        @Field("detail_address") detail_address: String?,
        @Field("email") email: String?,
        @Field("bank_card") bank_card: String?,
        @Field("bank_name") bank_name: String?,
        @Field("bank_region_code") bank_region_code: String?,
        @Field("bank_front_img") bank_front_img: String?,
        @Field("bank_back_img") bank_back_img: String?,
        @Field("bank_owner_hold_img") bank_owner_hold_img: String?,
        @Field("id_card_front_img") id_card_front_img: String?,
        @Field("id_card_back_img") id_card_back_img: String?,
        @Field("hold_id_card_front_img") hold_id_card_front_img: String?,
        @Field("hold_bank_front_img") hold_bank_front_img: String?,
    ): Response<JsonResult<Ret>>


    //完善资料
    @POST("/users/hfb_user_modify/")
    @FormUrlEncoded
    suspend fun editBank(
        @Field("bank_card") bank_card: String?,
        @Field("bank_name") bank_name: String?,
        @Field("bank_region_code") bank_region_code: String?,
        @Field("bank_front_img") bank_front_img: String?,
        @Field("bank_back_img") bank_back_img: String?,
        @Field("bank_owner_hold_img") bank_owner_hold_img: String?,
        @Field("apply_no") apply_no: String?,
    ): Response<JsonResult<Ret>>

    /**
     * 提现记录
     */
    @GET("/mall/mall_coupons/")
    suspend fun all_coupon(
    ): Response<JsonResult<AllCoupon>>

    /**
     * 领取优惠券
     */
    @FormUrlEncoded
    @POST("/mall/get_coupons/")
    suspend fun get_coupons(
        @Field("coupons_id") coupons_id: String
    ): Response<JsonResult<Ret>>

    /**
     * 我的优惠券
     */
    @FormUrlEncoded
    @POST("/users/user_coupons/")
    suspend fun user_coupons(
        @Field("page") page: Int,
        @Field("status") status: Int,
    ): Response<JsonResult<MeCoupon>>

    /**
     * 物流信息
     */
    @FormUrlEncoded
    @POST("/mall/deliver_info/")
    suspend fun deliver_info(
        @Field("order_id") order_id: String,
    ): Response<JsonResult<WlDetail>>

    /**
     * 当前订单
     */
    @GET("/mall/current_buy_order/")
    suspend fun current_buy_order(): Response<JsonResult<CurOrderDetail>>

    /**
     *
     */
    @FormUrlEncoded
    @POST("/mall/back_order_record/")
    suspend fun back_order_record(
        @Field("page") page: Int,
    ): Response<JsonResult<TuikuanList>>

    //退货
    @POST("/mall/goods_refunds/")
    @FormUrlEncoded
    suspend fun applyTuikuan(
        @Field("order_goods_id") order_goods_id: String,
        @Field("num") num: String,
        @Field("back_status") back_status: String,
        @Field("logistics_name") logistics_name: String,
        @Field("logistics_num") logistics_num: String,
    ): Response<JsonResult<Ret>>

    /**
     *
     */
    @FormUrlEncoded
    @POST("/mall/order_hall/")
    suspend fun order_hall(
        @Field("page") page: Int,
        @Field("t_type") t_type: Int = 1
    ): Response<JsonResult<GetDddRet>>

    /**
     *
     */
    @FormUrlEncoded
    @POST("/mall/deal_sell/")
    suspend fun deal_sell(
        @Field("order_id") order_id: String,
        @Field("bath_id") bath_id: String,
        @Field("num") num: String,
    ): Response<JsonResult<Ret>>

    /**
     *
     */
    @FormUrlEncoded
    @POST("/mall/deal_buy/")
    suspend fun deal_buy(
        @Field("order_id") order_id: String,
        @Field("num") num: String,
    ): Response<JsonResult<Ret>>

    /**
     * 商品买卖原价买
     */
    @FormUrlEncoded
    @POST("/mall/trade_goods_buy_yj/")
    suspend fun trade_goods_buy_yj(
        @Field("goods_id") goods_id: String,
        @Field("goods_price") goods_price: String,
        @Field("num") num: String,
    ): Response<JsonResult<Ret>>

    /**
     * 商品买卖特价买
     */
    @FormUrlEncoded
    @POST("/mall/trade_goods_buy_tj/")
    suspend fun trade_goods_buy_tj(
        @Field("goods_id") goods_id: String,
        @Field("goods_price") goods_price: String,
        @Field("num") num: String,
    ): Response<JsonResult<Ret>>

    /**
     * 商品买卖优惠买
     */
    @FormUrlEncoded
    @POST("/mall/trade_goods_buy_yh/")
    suspend fun trade_goods_buy_yh(
        @Field("goods_id") goods_id: String,
        @Field("goods_price") goods_price: String,
        @Field("num") num: String,
    ): Response<JsonResult<Ret>>

    /**
     *
     */
    @GET("/users/user_collect/")
    suspend fun wdgz(
        @Query("page") page: Int,
        @Query("name") name: String?
    ): Response<JsonResult<WdgzRet>>

    /**
     *
     */
    @GET("/mall/deal_deliver_record/")
    suspend fun deal_deliver_record(
        @Query("page") page: Int,
    ): Response<JsonResult<WdthRet>>


    /**
     * 修改密码
     */
    @FormUrlEncoded
    @POST("/mall/pick_up/")
    suspend fun applyTh(
        @Field("bath_id") bath_id: String,
        @Field("num") num: String,
        @Field("sh_name") sh_name: String,
        @Field("sh_phone") sh_phone: String,
        @Field("sh_place") sh_place: String,
        @Field("sh_province") sh_province: String,
        @Field("sh_city") sh_city: String,
        @Field("sh_district") sh_district: String,
    ): Response<JsonResult<Ret>>


    //创建订单
    @POST("/trading/recharge_orders/")
    @FormUrlEncoded
    suspend fun recharge_orders2(
        @Field("price") price: String,
        @Field("w_type") w_type: String,
    ): Response<JsonResult<RechargeOrders2>>

    //创建订单
    @POST("/trading/recharge_orders/")
    @FormUrlEncoded
    suspend fun recharge_orders3(
        @Field("price") price: String,
        @Field("w_type") w_type: String,
        @Field("token_no") token_no: String
    ): Response<JsonResult<RechargeOrders2>>


    //创建订单
    @POST("/trading/recharge_orders/")
    @FormUrlEncoded
    suspend fun recharge_orders(
        @Field("price") price: String,
        @Field("w_type") w_type: String
    ): Response<JsonResult<Ret>>

    /**
     * 获取当前充值订单
     */
    @POST("/trading/current_recharge/")
    suspend fun current_recharge(): Response<JsonResult<CurrentRechargeOrder>>

    @POST("/trading/del_order/")
    @FormUrlEncoded
    suspend fun del_order(
        @Field("order_id") order_id: String,
    ): Response<JsonResult<Ret>>

    //实名
    @POST("/users/real_user/")
    @FormUrlEncoded
    suspend fun set_real(
        @Field("id_card") id_card: String,
        @Field("id_img") id_img: String,
        @Field("real_name") real_name: String,
        @Field("sex") sex: String,
    ): Response<JsonResult<Ret>>

    //实名
    @POST("/users/reset_nickname/")
    @FormUrlEncoded
    suspend fun reset_nickname(
        @Field("nickname") nickname: String,
    ): Response<JsonResult<Ret>>

    /**
     * 用户信息
     */
    @FormUrlEncoded
    @POST("/users/search_name/")
    suspend fun queryUser(
        @Field("phone") phone: String,
    ): Response<JsonResult<QueryUser>>


    /*转让*/

    /**
     * zr
     */
    @FormUrlEncoded
    @POST("/mall/seller_transfer_order/")
    suspend fun seller_transfer_order(
        @Field("phone") phone: String,
        @Field("num") num: String,
//        @Field("bath_id") bath_id: String,
        @Field("goods_id") goods_id: String,
        @Field("price") price: String,
    ): Response<JsonResult<Ret>>

    /**
     * 转让冻结
     */
    @FormUrlEncoded
    @POST("/mall/seller_transfer_order/")
    suspend fun seller_transfer_order(
        @Field("phone") phone: String,
        @Field("num") num: String,
        @Field("bath_id") bath_id: String,
        @Field("t_type") t_type: Int,
        @Field("price") price: String,
    ): Response<JsonResult<Ret>>

    /**
     * zr
     */
    @FormUrlEncoded
    @POST("/mall/transfer_order_record/")
    suspend fun transfer_order_record(
        @Field("page") page: Int,
        @Field("t_type") t_type: String,
    ): Response<JsonResult<ZrAndSgRet>>

    /**
     * zr 转让记录 1转让 2收购
     */
    @FormUrlEncoded
    @POST("/mall/transfer_order_record_v2/")
    suspend fun transfer_order_record_v2(
        @Field("page") page: Int,
        @Field("t_type") t_type: String,
//        @Field("page_limit") page_limit: String,
    ): Response<JsonResult<ZrAndSgRet>>

    //提货(释放)列表 r_type=1提货 2待释放
    @POST("/mall/batch_record_v2/")
    @FormUrlEncoded
    suspend fun batch_record_v2(
        @Field("r_type") r_type: String,
        @Field("goods_id") goods_id: String,
        @Field("page") page: Int,
    ): Response<JsonResult<GetDddBatchRet>>

    /**
     * zr 点对点交易
     */
    @FormUrlEncoded
    @POST("/mall/pick_up_v2/")
    suspend fun pick_up_v2(
//        @Field("batch_id") batch_id: String,
        @Field("goods_id") goods_id: String,
        @Field("num") num: String,
        @Field("pick_type") pick_type: String,//1.资产一，2.资产二，3.提货商品，4.可交易商品
        @Field("address_id") address_id: String

//        @Field("sh_name") sh_name: String,
//        @Field("sh_phone") sh_phone: String,
//        @Field("sh_province") sh_province: String,
//        @Field("sh_city") sh_city: String,
//        @Field("sh_district") sh_district: String,
//        @Field("sh_place") sh_place: String,
    ): Response<JsonResult<Ret>>

    /**
     * zr
     */
    @FormUrlEncoded
    @POST("/mall/transfer_order_record/")
    suspend fun transfer_order_record(
        @Field("page") page: Int,
        @Field("t_type") t_type: String,
        @Field("r_type") r_type: String,
    ): Response<JsonResult<ZrAndSgRet>>

    /**
     * zr
     */
    @FormUrlEncoded
    @POST("/mall/buyer_confirm/")
    suspend fun buyer_confirm(
        @Field("order_id") order_id: String,
    ): Response<JsonResult<Ret>>


    /**
     * zr 买家确认
     */
    @FormUrlEncoded
    @POST("/mall/confirm_buyer/")
    suspend fun zr_confirm_buyer(
        @Field("order_id") order_id: String,
    ): Response<JsonResult<Ret>>

    /**
     * zr 一键转存
     */
    @FormUrlEncoded
    @POST("/mall/one_touch_redeposit/")
    suspend fun one_touch_redeposit(
        @Field("goods_id") goods_id: String,
    ): Response<JsonResult<Ret>>

    /**
     * zr
     */
    @FormUrlEncoded
    @POST("/mall/del_transfer_order/")
    suspend fun del_transfer_order(
        @Field("order_id") order_id: String,
    ): Response<JsonResult<Ret>>

    /**
     * 撤回点对点
     */
    @FormUrlEncoded
    @POST("/mall/fail_transfer_order/")
    suspend fun fail_transfer_order(
        @Field("order_id") order_id: String,
    ): Response<JsonResult<Ret>>

    /**
     * 提现记录
     */
    @GET("/users/day_count/")
    suspend fun day_count(
    ): Response<JsonResult<Wdtj>>


    /**
     * zr 点对点交易，普通点对点
     */
    @FormUrlEncoded
    @POST("/mall/seller_transfer_batch/")
    suspend fun seller_transfer_batch(
        @Field("phone") phone: String,
        @Field("num") num: String,
//        @Field("t_type") t_type: String,
//        @Field("batch_id") bath_id: String,
        @Field("goods_id") goods_id: String,
        @Field("goods_price") goods_price: String,
    ): Response<JsonResult<Ret>>


    /**
     * zr 冻结点对点
     */
    @FormUrlEncoded
    @POST("/mall/release_transfer/")
    suspend fun release_transfer(
        @Field("phone") phone: String,
        @Field("num") num: String,
//        @Field("t_type") t_type: String,
//        @Field("batch_id") bath_id: String,
        @Field("goods_id") goods_id: String,
        @Field("goods_price") goods_price: String,
    ): Response<JsonResult<Ret>>

    /**
     * zr 预支点对点
     */
    @FormUrlEncoded
    @POST("/mall/borrow_transfer/")
    suspend fun borrow_transfer(
        @Field("phone") phone: String,
        @Field("num") num: String,
//        @Field("t_type") t_type: String,
//        @Field("batch_id") bath_id: String,
        @Field("goods_id") goods_id: String,
        @Field("goods_price") goods_price: String,
    ): Response<JsonResult<Ret>>

    /**
     * zr 挂单
     */
    @FormUrlEncoded
    @POST("/mall/hang_order/")
    suspend fun hang_order(
        @Field("goods_id") goods_id: String,
        @Field("goods_price") price: String,//单价，挂牌批发专区不用输入价格
        @Field("num") num: String,
        @Field("r_type") r_type: String,//1挂牌服务中心，2挂牌供应商
    ): Response<JsonResult<Ret>>

    /**
     * zr 特价券明细
     */
    @FormUrlEncoded
    @POST("/mall/mall_coupon_record/")
    suspend fun mall_coupon_record(
        @Field("goods_id") goods_id: String,
        @Field("status") status: String,//0正常1已使用 2已过期
        @Field("page") page: Int,
    ): Response<JsonResult<ZrOrder>>


    /**
     * zr 挂单大厅，（摘牌服务中心 摘牌供应商）
     */
    @GET("/mall/hanging_order_hall/")
    suspend fun hanging_order_hall(
        @Query("goods_id") goods_id: String,
        @Query("page") page: Int,
//        @Query("page_limit") page_limit: Int,//分页大小，不传默认20
    ): Response<JsonResult<ZrOrder>>

    /**
     * zr 我的挂单
     */
    @GET("/mall/hanging_order_record/")
    suspend fun hanging_order_record(
        @Query("goods_id") goods_id: String,
        @Query("page") page: Int,
        @Query("status") status: String, //已完成1 挂单中0
        //0正常，1已完成，2已撤销
//        @Query("page_limit") page_limit: Int,//分页大小，不传默认20
//        @Query("r_type") r_type: String,//1挂单服务中心，2挂单供应商

    ): Response<JsonResult<HangOrderRecord>>

    /**
     * zr 摘单
     */
    @FormUrlEncoded
    @POST("/mall/pick_order/")
    suspend fun pick_order(
        @Field("order_id") order_id: String,
        @Field("num") num: String,
    ): Response<JsonResult<Ret>>

    /**
     * zr 撤单
     */
    @FormUrlEncoded
    @POST("/mall/revoke_hang_order/")
    suspend fun revoke_hang_order(
        @Field("order_id") order_id: String,
    ): Response<JsonResult<Ret>>


    @FormUrlEncoded
    @POST("/trading/order_pay/")
    suspend fun order_pay(
        @Field("order_id") order_id: String,
    ): Response<JsonResult<RechargeOrders2>>

    //k_type=0  分时
    //k_type=1  五日
    //k_type=2  日k
    //k_type=3  周k
    //k_type=4  月k
    @GET("/mall/goods_k_line/")
    suspend fun goods_kline_oneday_5day(
        @Query("goods_id") goods_id: String,
        @Query("k_type") k_type: Int,
    ): Response<JsonResult<KMinute5>> //KMinute5

    @GET("/mall/goods_k_line/")
    suspend fun goods_k_line(
        @Query("goods_id") goods_id: String,
        @Query("k_type") k_type: Int,
    ): Response<JsonResult<KDay2>>

    /**
     * k_type=5  1分
     *
     */
    @GET("/mall/goods_k_line/")
    suspend fun goods_k_line_xm(
        @Query("goods_id") goods_id: String,
        @Query("k_type") k_type: Int,
        @Query("k_date") k_date: String?,
    ): Response<JsonResult<KDay2>>

    @GET("/mall/goods_k_line_index/")
    suspend fun goods_k_line_head(
        @Query("goods_id") goods_id: String,
    ): Response<JsonResult<KLineHead>>

    /**
     * 划转
     */
    @FormUrlEncoded
    @POST("/mall/transfer_ticket/")
    suspend fun transfer_ticket(
        @Field("goods_id") goods_id: String,
        @Field("phone") phone: String,
//        @Field("real_name") real_name: String,
        @Field("num") num: String
    ): Response<JsonResult<Ret>>

    //创建订单
    @POST("/trading/recharge_orders/")
    @FormUrlEncoded
    suspend fun dePay(
        @Field("price") price: String?,
        @Field("w_type") w_type: String?,
        @Field("real_name") real_name: String?,
        @Field("bank_card") bank_card: String?,
    ): Response<JsonResult<RechargeOrders2>>

    /**
     * 获取验证码
     */
    @FormUrlEncoded
    @POST("/users/user_dg_info/")
    suspend fun user_dg_info(
        @Field("c_type") c_type: String,
        @Field("cert_begin_date") cert_begin_date: String?,
        @Field("cert_end_date") cert_end_date: String?,
    ): Response<JsonResult<Ret>>
}